<template>
    <div class="cl6">
        <div class="iHead1">信访情况统计</div>
        <div class="main">
            <div class="m-i">
                <img src="@/assets/wbg.9be9092b.gif" alt="">
                <div></div>
                <p>来县</p>
                <span :style="{ textShadow: '0 0 12px ' + colorArr[0][0] }">{{ mainData[0] }}</span>
                <b :style="{ backgroundColor: colorArr[0][0], boxShadow: '0 0 12px ' + colorArr[0][1] }"></b>
            </div>
            <div class="m-i">
                <img src="@/assets/wbg.9be9092b.gif" alt="">
                <div></div>
                <p>赴市</p>
                <span :style="{ textShadow: '0 0 12px ' + colorArr[1][0] }">{{ mainData[1] }}</span>
                <b :style="{ backgroundColor: colorArr[1][0], boxShadow: '0 0 12px ' + colorArr[1][1] }"></b>
            </div>
            <div class="m-i">
                <img src="@/assets/wbg.9be9092b.gif" alt="">
                <div></div>
                <p>赴省</p>
                <span :style="{ textShadow: '0 0 12px ' + colorArr[2][0] }">{{ mainData[2] }}</span>
                <b :style="{ backgroundColor: colorArr[2][0], boxShadow: '0 0 12px ' + colorArr[2][1] }"></b>
            </div>
            <div class="m-i">
                <img src="@/assets/wbg.9be9092b.gif" alt="">
                <div></div>
                <p>进京</p>
                <span :style="{ textShadow: '0 0 12px ' + colorArr[3][0] }">{{ mainData[3] }}</span>
                <b :style="{ backgroundColor: colorArr[3][0], boxShadow: '0 0 12px ' + colorArr[3][1] }"></b>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    props: ['infoData', 'posItem', 'yearItem'],
    data() {
        return {
            colorArr: [['#eb2734', '#e7999e'], ['#348d16', '#a0db8d'], ['#3c7ffd', '#a1c1fc'], ['#e431a8', '#e990cb'], ['#e9973a', '#f5cb9c']],
            mainData: [],
        }
    },
    watch: {
        posItem: function (infoData) {
            this.mainDataInit();
        },
        yearItem: function (infoData) {
            this.mainDataInit();
        },
    },
    mounted() {
        this.mainDataInit();

    },
    methods: {
        mainDataInit() {
            this.mainData = [];
            this.infoData[22].map((i, o) => {
                if (i[0] == this.posItem) {
                    this.mainData = JSON.parse(i[this.yearItem])
                }
            })
        }
    }
}
</script>

<style lang="scss" scoped>
.cl6 {
    width: 300px;
    height: 340px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;

    &::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 300px;
        height: 340px;
        z-index: 1;
        background-image: url('../../assets/denglukuang.png');
        background-repeat: no-repeat;
        background-size: 100% 100%;
        opacity: .4;
    }

    .main {
        position: relative;
        z-index: 2;
        width: 95%;
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: space-around;
        padding-top: 10px;

        .m-i {
            width: 60px;
            position: relative;
            height: 270px;
            cursor: pointer;

            div {
                background-image: url('../../assets/xiaobeijing2.png');
                background-size: 100% 100%;
                width: 100%;
                height: 100%;
                position: absolute;
                z-index: 3;
                background-color: #243F6211;
                border-radius: 8px;
                transition: all .6s;
            }

            img {
                width: 80px;
                height: 80px;
                position: absolute;
                opacity: .4;
                top: 90px;
                left: -10px;
            }

            p {
                position: absolute;
                font-family: 'PMZD';
                font-size: 22px;
                width: 100%;
                text-align: center;
                letter-spacing: 5px;
                text-shadow: 0 0 12px #000;
                top: 50px;
            }

            span {
                position: absolute;
                display: block;
                width: 100%;
                text-align: center;
                text-shadow: 0 0 12px #000;
                font-family: 'PMZD';
                font-size: 42px;
                top: 105px;

            }

            b {
                position: absolute;
                display: block;
                width: 40px;
                height: 3px;
                border-radius: 3px;
                opacity: .6;
                left: calc(50% - 20px);
                top: 195px;
            }
        }

        .m-i:hover {
            div {
                background-color: #559fff22;
                box-shadow: 0 0 12px #00000055;
                transform: rotateY(180deg);

            }
        }
    }
}
</style>